Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Dec 7, 2024

in microservices, logs are often collected using busy waiting loops, where the system constantly checks for new logs. This leads to several issues:

Wasting Resources: The system keeps checking for new logs, using up CPU resources even when there are no logs to process.
Scalability Problems: As the number of services grows, busy waiting loops become inefficient and slow, causing delays and performance issues.
Increased Latency: Logs are delayed because the system is busy checking for new data rather than processing logs as they arrive.

This PR solves these problems by switching to a more efficient event-driven log aggregation system. Instead of constantly checking for new logs, the system reacts only when new logs are available, reducing unnecessary CPU usage and improving scalability and performance

null62 and others added 4 commits December 7, 2024 17:50
issue This PR Solves
In microservices, logs are often collected using busy waiting loops, where the system constantly checks for new logs. This leads to several issues:

Wasting Resources: The system keeps checking for new logs, using up CPU resources even when there are no logs to process.

Increased Latency: Logs are delayed because the system is busy checking for new data rather than processing logs as they arrive.   

This PR solves these problems by switching to a more efficient event-driven log aggregation system. Instead of constantly checking for new logs, the system reacts only when new logs are available, reducing unnecessary CPU usage and improving scalability and performance.
The Scheduler design pattern provides a clean and structured solution to manage and execute tasks automatically. It involves:

Scheduler: A component responsible for managing the execution of tasks, ensuring they run at the correct time or under the right conditions.
Task: A unit of work that encapsulates the logic to be executed.
Trigger/Condition: Defines when and how often a task should execute, whether it's based on time intervals (e.g., every minute) or events 
Execution Context: Ensures that tasks are executed in the right environment, managing resources, states, and concurrency.

By using this pattern, tasks are managed centrally, execution timing is automated, and the system can handle various triggers and execution conditions efficiently, allowing developers to focus on defining what needs to be done instead of when and how to execute it.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the changes seem to affect only README.md files, so the software behavior is still unfixed

Repository owner closed this by deleting the head repository Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants